import request from '@/utils/request'

//查询用户列表
export function userList(query) {
  return request({
    url:'/api/user/list',
    method:'get',
    params:query
  })
}
//新增用户
export function addUser(data) {
  return request({
    url:'/api/user/adduser',
    method:'post',
    data:data
  })
}
//获取用户详情
export function queryUserById(userId) {
  return request({
    url:'/api/user/queryUser/'+userId,
    method:'get'
  })
}
//修改用户
export function updateUser(data) {
  return request({
    url:'/api/user/updateUser',
    method:'post',
    data:data
  })
}
//删除用户
export function delUser(userId){
  return request({
    url:'/api/user/deleteUser/'+userId,
    method:'delete'
  })
}
//批量删除
export function delUsers(userIds) {
  return request({
    url:'/api/user/deleteUserBatch/'+userIds,
    method:'delete',
    // params:userIds
  })
}
//重置密码
export function resetUserPwd(userId, password) {
  const data = {
    userId,
    password
  }
  return request({
    url: '/api/user/updateUser',
    method: 'post',
    data: data
  })
}
